<%@ page contentType="text/html; charset=utf-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>新增单证</title>
        <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/interface/CountryDAO.js'></script>
        <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/interface/ProductDAO.js'></script>
        <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/interface/DocumentGroupDAO.js'></script>
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/zcms/zDialog.js"></script>
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/zcms/zDrag.js"></script>
        <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/engine.js'></script>
        <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/util.js'></script>
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/swfobject/swfobject.js"></script> 
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.6.1.min.js"></script> 
        <script type="text/javascript" src="${pageContext.request.contextPath}/js/flexpaper_flash.js"></script> 
        <script type="text/javascript">
          

            var fileInputNumber = 0;
            var fileName = "";
            function addFile()　　  	{	


                var strFile = "file"+fileInputNumber;
                var filePath = document.getElementById(strFile);


                document.getElementById(strFile).style.display = "none";
                var paths = filePath.value.split("\\");
                var name = paths[paths.length-1];
		
                fileName=fileName+"%"+name;
			
                document.getElementById("fileName").value=fileName;
	
                var str1 =
                    '<div style="background-color:#E7EBF7">'+
                    '<font size="2" style="width:300px">'+name+'</font>'+
                    '<a href="#"><img onclick="removeFile(this,'+strFile+')" src="../images/del2.gif" border="0" alt="删除附件"/></a>'+
                    '</div>';
                var _file = document.getElementById("_file");
			
                _file.insertAdjacentHTML("beforeend",str1);
                addInput();
            }
	
            function addInput(){
                fileInputNumber++;
                var strFile = "file"+fileInputNumber;
                var str2 = '<input name="file" id="'+strFile+'" type="file" value="添加附件" onchange="addFile()" />';
                var _input = document.getElementById("input");
                _input.insertAdjacentHTML("afterbegin",str2);
	
            }
        	
            function removeFile(id,strFile) {
                var new_tr = id.parentNode.parentNode;
                try {
                    //new_tr.removeNode(true);
                    // just ie , not w3c;
                    // other idea
                    var tmp = new_tr.parentNode;
                    // 为了在ie和firefox下都能正常使用,就要用另一个方法代替,最取上一层的父结点,然后remove.
                    tmp.removeChild(new_tr);		
                    removeInput(strFile);
                } catch(e) {}
            }
            function removeInput(strFile) {
                var _input = document.getElementById("input");
                try {
                    //new_tr.removeNode(true);
                    // just ie , not w3c;
                    // other idea
                    // 为了在ie和firefox下都能正常使用,就要用另一个方法代替,最取上一层的父结点,然后remove.
                    input.removeChild(strFile);
                } catch(e) {}
            }
            function sub(){
                return true;
            }

     
        </script>
<style>
body,td,th{font-size:12px}
.alllisttitle{ padding-left:10px}
a:link,a:visited{ color:#000000; text-decoration:none}
a:hover{ color:#ff0000; text-decoration:none}
select{ background:#ffffff!important}
</style>
    </head>

    <body>
        <s:form action="save" namespace="/documentCase" method="post"
                enctype="multipart/form-data" theme="simple">
            <s:hidden id="fileName" name="fileName"></s:hidden>
            <table width="100%" height="100%" border="0"  align="center" cellpadding="2" cellspacing="1">
                <tr>
                    <td width="15%" bgcolor="#b5d6e6" align="right" >案例编号</td>
                    <td width="35%" align="center" bgcolor="#EBF4F5"><s:property value="ca.code"/></td>
                    <td width="15%" bgcolor="#b5d6e6" align="right">案例名称</td>
                    <td width="35%" align="center" bgcolor="#EBF4F5"><s:property value="ca.name"/></td>
                </tr>
                <tr>
                   <td bgcolor="#b5d6e6"  align="right">采购国</td>
                    <td align="center" bgcolor="#EBF4F5"><s:property value="ca.countryName"/></td>
          
                    <td bgcolor="#b5d6e6"  align="right">产品</td>
                    <td align="center" bgcolor="#EBF4F5"><s:property value="ca.productName"/></td>
                </tr>               
                <tr>
                    <td bgcolor="#b5d6e6"  align="right">案例要点和解析</td>
                    <td colspan="3" align="center" bgcolor="#EBF4F5"><s:property value="ca.fillSummy"/></td>
                </tr>
   
                <tr>
                    <td height="100" rowspan="2" align="right"  bgcolor="#deebf1">
                        <img src="../img/jiedian.gif" width="10" height="9"/>
                        附件：
                    </td>
                    <td height="100" colspan="3" align="center">
                        <table width="100%" height="100%" border="0" cellpadding="4"
                               cellspacing="1" bgcolor="#FFFFFF">
                            <s:iterator value="accessoryList" var="accesory">
                              
                                <tr>
                                    <a href="down.action?dlFileName=<s:property value='name'></s:property>">
                                        <s:property value="truename"></s:property> </a>
                                </tr>
                                 <script type="text/javascript">
            //            swfobject.embedSWF("/doc/3.swf", "swfid", "300", "120", "9.0.0", "/js/swfobject/expressInstall.swf"); 
//            var swfname=<s:property value="truename"/>.split(".")[0]+"swf";

            var swfVersionStr = "9.0.124";
            var xiSwfUrlStr = "${pageContext.request.contextPath}/js/FlexPaperViewer.swf";
            var flashvars = { 
//                 SwfFile : escape("${pageContext.request.contextPath}/doc/3.swf"),
                SwfFile : escape("${pageContext.request.contextPath}/upload/document/1112090023335182.swf"),
                Scale : 0.6, 
                ZoomTransition: "linear",  
                ZoomTime: "greater",  
                ZoomInterval: 0.1,  
                FitPageOnLoad: false,  
                FitWidthOnLoad: false,  
                PrintEnabled: true,  
                FullScreenAsMaxWindow: false,  
                ProgressiveLoading: false,  
       
                PrintToolsVisible: true,  
                ViewModeToolsVisible: true,  
                ZoomToolsVisible: true,  
                FullScreenVisible: true,  
                NavToolsVisible: true,  
                CursorToolsVisible: true,  
                SearchToolsVisible: false,  
                localeChain: "zh_CN"  
            };
            var params = {
					
            }
            params.quality = "high";  
            params.bgcolor = "#ffffff";  
            params.allowscriptaccess = "sameDomain";  
            params.allowfullscreen = "true";  
            var attributes = {};  
            attributes.id = "FlexPaperViewer";  
            attributes.name = "FlexPaperViewer";  
            swfobject.embedSWF(
            "${pageContext.request.contextPath}/js/FlexPaperViewer.swf", "swfid", 
            "600", "500", 
            swfVersionStr, xiSwfUrlStr, 
            flashvars, params, attributes);
            swfobject.createCSS("#swfid", "display:block;text-align:center;");
        </script>
                                <tr>  <div id="swfid"></div></tr>
                            </s:iterator>
                        </table>
                    </td>
                </tr>
               
            </table>

        </s:form>
    </body>

</html>